<?php 
$date = date("Y-m-d");
$date = strtotime(date("Y-m-d", strtotime($date)) . "-12 months");
$m_start = date("Y-m-d",$date);
$m_end=date("Y-m-d");
?>


<script type="text/javascript">

function submit(aid) {
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
											  history.back();				 
										  }
									  }
	xmlhttp.open("GET","<?php echo base_url("account/close_account")?>?aid="+aid,true);
	xmlhttp.send();
}

</script>

<div class="content_table_detail" style="padding-top: 20px;">
<table cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse;margin-left: -10px;margin-top: -20px;width: 980px;background: url('<?php echo base_url('images/title_03.gif') ?>') repeat-x scroll 0% 0% transparent;" >
				<thead>
					<tr>
						<th style="text-align: left;background: url('<?php echo base_url('images/title_03.gif') ?>') repeat-x scroll 0% 0% transparent;height: 24px;">Chi tiết tài khoản</th>
						
					</tr>
				</thead>
				</table>
				<br>
				
			<br>
			
			<table cellspacing="0" cellpadding="0" border="0" >
				<tbody>
					
					<tr>
						<th style="width: 120px;">Họ tên</th>
						<td >
							<div class="contBox"><?=$account[0]['name']?></div>
						</td>
						<th style="width: 120px;">Ngày gia nhập</th>
						<td>
							<div class="contBox"><?=$account[0]['join_day']?></div>
						</td>
					</tr>
					
					<tr>
						<th style="width: 120px;">Email</th>
						<td colspan="3">
							<div class="contBox"><?=$account[0]['email']?></div>
						</td>
					</tr>
					<tr>
						<th style="width: 120px;">Giới tính</th>
						<td colspan="3">
							<div class="contBox"><?php if($account[0]['sex']==1) echo "Nam"; else echo "Nữ";?></div>
						</td>
					</tr>
					<tr>
						<th style="width: 120px;">Số điện thoại</th>
						<td colspan="3">
							<div class="contBox"><?=$account[0]['phone']?></div>
						</td>
					</tr>
					<tr>
						<th style="width: 120px;">Địa chỉ</th>
						<td colspan="3">
							<div class="contBox"><?=$account[0]['address']?></div>
						</td>
					</tr>
					<tr>
						<th style="width: 120px;">Tỉnh/Thành phố</th>
						<td >
							<div class="contBox"><?=$account[0]['ncity']?></div>
						</td>
						<th style="width: 120px;">Quận/Huyện</th>
						<td>
							<div class="contBox"><?=$account[0]['ndistrict']?></div>
						</td>
					</tr>
					<tr>
						<th style="width: 120px;">Phân loại</th>
						<td colspan="3">
							<div class="contBox"><?php if($account[0]['type']==1) echo "Cửa hàng"; else echo "Khách hàng";?></div>
						</td>
					</tr>
					<tr>
						<th style="width: 120px;">Trạng thái</th>
						<td colspan="3">
							<div class="contBox"><?php if($account[0]['status']==1) echo "Đang sử dụng"; else echo "Bị khóa";?></div>
						</td>
					</tr>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="4">
							<?php if($account[0]['status']==1){?>
							<div class="divBtn" style="width:100px; float:right; margin:0px 5px;" onclick="submit(<?=$aid?>)">Đóng tài khoản</div> 
							<?php }?>
							<div class="divBtn" style="width:100px; float:right;" onclick="history.back()">Trở lại</div> 
						</td>
					</tr>
				</tfoot>
			</table>
			</div>
	